package com.ruoyi.task.domain;


import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * @Author:
 * @Data:2025/3/19 16:09
 * @Description: TODO
 */
public class ModelParams extends BaseEntity {


    private static final long serialVersionUID = 1L;

    /**
     * 分行
     */
    private String branchBank;

    /**
     * 文件id（通常用于关联上传的参考文件）
     */
    private String fileId;

    /**
     * 提示词（用户输入的生成引导文本）
     */
    private String prompt;

    /**
     * 最大token数（限制生成内容的最大长度，通常100-2000）
     */
    private int maxTokens;

    /**
     * 重复惩罚系数（大于1降低重复，小于1允许更多重复，典型值1.2）
     */
    private Double repetitionPenalty;

    /**
     * 温度系数（0-2，值越高随机性越强，建议0.7-1.0）
     */
    private Double temperature;

    /**
     * Top-p采样（0-1，选择累积概率达p的最小候选集，通常0.9）
     */
    private Double topP;

    /**
     * Top-k采样（保留概率最高的k个token，常用50）
     */
    private Integer topK;

    /**
     * 频率惩罚（降低重复出现token的概率，类似重复惩罚）
     */
    private Double frequencyPenalty;

    /**
     * 存在惩罚（降低已出现token的概率，促进新主题生成）
     */
    private Double presencePenalty;

    public String getBranchBank() {
        return branchBank;
    }

    public void setBranchBank(String branchBank) {
        this.branchBank = branchBank;
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getPrompt() {
        return prompt;
    }

    public void setPrompt(String prompt) {
        this.prompt = prompt;
    }

    public int getMaxTokens() {
        return maxTokens;
    }

    public void setMaxTokens(int maxTokens) {
        this.maxTokens = maxTokens;
    }

    public Double getRepetitionPenalty() {
        return repetitionPenalty;
    }

    public void setRepetitionPenalty(Double repetitionPenalty) {
        this.repetitionPenalty = repetitionPenalty;
    }

    public Double getTemperature() {
        return temperature;
    }

    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }

    public Double getTopP() {
        return topP;
    }

    public void setTopP(Double topP) {
        this.topP = topP;
    }

    public Integer getTopK() {
        return topK;
    }

    public void setTopK(Integer topK) {
        this.topK = topK;
    }

    public Double getFrequencyPenalty() {
        return frequencyPenalty;
    }

    public void setFrequencyPenalty(Double frequencyPenalty) {
        this.frequencyPenalty = frequencyPenalty;
    }

    public Double getPresencePenalty() {
        return presencePenalty;
    }

    public void setPresencePenalty(Double presencePenalty) {
        this.presencePenalty = presencePenalty;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("fileId", getFileId())
                .append("prompt", getPrompt())
                .append("maxTokens", getMaxTokens())
                .append("repetitionPenalty", getRepetitionPenalty())
                .append("temperature", getTemperature())
                .append("topP", getTopP())
                .append("topK", getTopK())
                .append("frequencyPenalty", getFrequencyPenalty())
                .append("presencePenalty", getPresencePenalty())
                .toString();
    }
}
